(function(){ var nav=document.getElementById('site-navigation'), button, menu; if(! nav){ return; } button=nav.getElementsByTagName('button')[0]; menu=nav.getElementsByTagName('ul')[0]; if(! button){ return; } if(! menu||! menu.childNodes.length){ button.style.display='none'; return; } button.onclick=function(){ if(-1===menu.className.indexOf('nav-menu')){ menu.className='nav-menu'; } if(-1!==button.className.indexOf('toggled-on')){ button.className=button.className.replace(' toggled-on', ''); menu.className=menu.className.replace(' toggled-on', ''); }else{ button.className +=' toggled-on'; menu.className +=' toggled-on'; }};})(); (function($){ $('.main-navigation').find('a').on('focus.twentytwelve blur.twentytwelve', function(){ $(this).parents('.menu-item, .page_item').toggleClass('focus'); }); if('ontouchstart' in window){ $('body').on('touchstart.twentytwelve', '.menu-item-has-children > a, .page_item_has_children > a', function(e){ var el=$(this).parent('li'); if(! el.hasClass('focus')){ e.preventDefault(); el.toggleClass('focus'); el.siblings('.focus').removeClass('focus'); }}); }})(jQuery); !function(d,l){"use strict";var e=!1,n=!1;if(l.querySelector)if(d.addEventListener)e=!0;if(d.wp=d.wp||{},!d.wp.receiveEmbedMessage)if(d.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){for(var r,i,a,s=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),n=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),o=new RegExp("^https?:$","i"),c=0;c')[0]; el.style.cssText='pointer-events:auto'; return !el.style.pointerEvents})(), isTouchDevice=false, thumbsContainerWidth, thumbsTotalWidth, activeThumb=$(), blankImg="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", transformOrigin=getPrefixed('transformOrigin'), transition=getPrefixed('transition'), transitionend="transitionend webkitTransitionEnd oTransitionEnd otransitionend", raf=window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || function(cb){ return window.setTimeout(cb, 1000 / 60); }, preload={}, preloadPrev=new Image(), preloadNext=new Image(), closeBtn, image, video, prevBtn, nextBtn, thumbsToggler, caption, captionText, pbLoader, autoplayBtn, thumbs, wrapper, defaults={ single:false, beforeShow:null, afterClose:null, loop:true, thumb:null, thumbs:true, thumbAttr:'data-src', counter:"(A/B)", title:true, autoplay:false, time:3000, history:false, hideFlash:true, zoomable:true, wheelNextPrev:true, keys:{ close:[27, 88, 67], prev:[37, 80], next:[39, 78] }}, overlay=$('
').append(thumbsToggler=$(''), pbLoader=$('
'), prevBtn=$('
').on('click', next_prev), nextBtn=$('
').on('click', next_prev), wrapper=$('
').append(image=$(''), video=$('
') ), closeBtn=$('
').on('click', close)[0], autoplayBtn=$('
').append($('
') ), caption=$('
').append('', captionText=$('
').append('
'), thumbs=$('
').addClass('pbThumbs') ) ); function throttle(callback, duration){ var wait=false; return function(){ if(!wait){ callback.call(); wait=true; setTimeout(function(){wait=false; }, duration); }} } function prepareDOM(){ noPointerEvents&&overlay.hide(); $(doc).on('touchstart.testMouse', function(){ $(doc).off('touchstart.testMouse'); isTouchDevice=true; overlay.addClass('mobile'); }); autoplayBtn.off().on('click', APControl.toggle); thumbs.off().on('click', 'a', thumbsStripe.click); isOldIE&&overlay.addClass('msie'); overlay.off().on('click', 'img', function(e){ e.stopPropagation(); }); $(doc.body).append(overlay); docElm=doc.documentElement; } $.fn.photobox=function(target, settings, callback){ return this.each(function(){ var o, PB_data=$(this).data('_photobox'); if(PB_data){ if(target==='destroy') PB_data.destroy(); return this; } if(typeof target!='string') target='a'; if(target==='prepareDOM'){ prepareDOM(); return this; } o=$.extend({}, defaults, settings||{}); photobox=new Photobox(o, this, target); $(this).data('_photobox', photobox); photobox.callback=callback; }); } Photobox=function(_options, object, target){ this.options=$.extend({}, _options); this.target=target; this.selector=$(object||doc); this.thumbsList=null; var filtered=this.imageLinksFilter(this.selector.find(target)); this.imageLinks=filtered[0]; this.images=filtered[1]; this.init(); }; Photobox.prototype={ init:function(){ var that=this; this.selector.one('mouseenter.photobox', this.target, function(e){ that.thumbsList=thumbsStripe.generate.apply(that); }); this.selector.on('click.photobox', this.target, function(e){ e.preventDefault(); that.open(this); }); this.observerTimeout=null; if(!isOldIE&&this.selector[0].nodeType==1) this.observeDOM(this.selector[0], this.onDOMchanges.bind(this)); }, onDOMchanges:function(){ var that=this; clearTimeout(this.observerTimeout); that.observerTimeout=setTimeout(function(){ var filtered=that.imageLinksFilter(that.selector.find(that.target)), activeIndex=0, isActiveUrl=false, i; if(that.imageLinks.length==filtered[0].length) return; that.imageLinks=filtered[0]; that.images=filtered[1]; if(photobox){ if(that.selector==photobox.selector){ images=that.images; imageLinks=that.imageLinks; for(i=images.length; i--;){ if(images[i][0]==activeURL) isActiveUrl=true; }} } that.thumbsList=thumbsStripe.generate.apply(that); thumbs.html(that.thumbsList); if(that.images.length&&activeURL&&that.options.thumbs){ activeIndex=that.thumbsList.find('a[href="'+activeURL+'"]').eq(0).parent().index(); if(activeIndex==-1) activeIndex=0; thumbsStripe.changeActive(activeIndex, 0); }}, 50); }, open:function(link){ var startImage=$.inArray(link, this.imageLinks); if(startImage==-1) return false; options=this.options; images=this.images; imageLinks=this.imageLinks; photobox=this; this.setup(1); overlay.on(transitionend, function(){ overlay.off(transitionend).addClass('on'); changeImage(startImage, true); }).addClass('show'); if(isOldIE) overlay.trigger('MSTransitionEnd'); return false; }, imageLinksFilter:function(obj){ var that=this, images=[], caption={}, captionlink; return [obj.filter(function(i){ var link=$(this), thumbImg, thumbSrc=''; caption.content=link[0].getAttribute('title')||''; if(that.options.thumb) thumbImg=link.find(that.options.thumb)[0]; if(!that.options.thumb||!thumbImg) thumbImg=link.find('img')[0]; if(thumbImg){ captionlink=thumbImg.getAttribute('data-pb-captionlink'); thumbSrc=thumbImg.getAttribute(that.options.thumbAttr)||thumbImg.getAttribute('src'); caption.content=(thumbImg.getAttribute('alt')||thumbImg.getAttribute('title')||''); } if(captionlink){ captionlink=captionlink.split('['); if(captionlink.length==2){ caption.linkText=captionlink[0]; caption.linkHref=captionlink[1].slice(0,-1); }else{ caption.linkText=captionlink; caption.linkHref=captionlink; } caption.content +=' ' + caption.linkText + ''; } images.push([link[0].href, caption.content, thumbSrc]); return true; }), images]; }, observeDOM:(function(){ var MutationObserver=win.MutationObserver||win.WebKitMutationObserver, eventListenerSupported=win.addEventListener; return function(obj, callback){ if(MutationObserver){ var that=this, obs=new MutationObserver(function(mutations, observer){ if(mutations[0].addedNodes.length||mutations[0].removedNodes.length) callback(that); }); obs.observe(obj, { childList:true, subtree:true }); } else if(eventListenerSupported){ obj.addEventListener('DOMNodeInserted', callback.bind(that), false); obj.addEventListener('DOMNodeRemoved', callback.bind(that), false); }} })(), setup:function (open){ var fn=open ? "on":"off"; if(options.thumbs){ if(!isTouchDevice){ thumbs[fn]('mouseenter.photobox', thumbsStripe.calc) [fn]('mousemove.photobox', thumbsStripe.move); }} if(open){ image.css({'transition':'0s'}).removeAttr('style'); overlay.show(); thumbs .html(this.thumbsList) .trigger('mouseenter.photobox'); if(options.thumbs){ overlay.addClass('thumbs'); }else{ thumbsToggler.prop('checked', false); overlay.removeClass('thumbs'); } if(this.images.length < 2||options.single) overlay.removeClass('thumbs hasArrows hasCounter hasAutoplay'); else{ overlay.addClass('hasArrows hasCounter') if(options.time > 1000){ overlay.addClass('hasAutoplay'); if(options.autoplay) APControl.progress.start(); else APControl.pause(); } else overlay.removeClass('hasAutoplay'); } options.hideFlash&&$('iframe, object, embed').css('visibility', 'hidden'); }else{ $(win).off('resize.photobox'); } $(doc).off("keydown.photobox")[fn]({ "keydown.photobox": keyDown }); if(isTouchDevice){ overlay.removeClass('hasArrows'); wrapper[fn]('swipe', onSwipe); } if(options.zoomable){ overlay[fn]({"mousewheel.photobox": scrollZoom }); if(!isOldIE) thumbs[fn]({"mousewheel.photobox": thumbsResize }); } if(!options.single&&options.wheelNextPrev){ overlay[fn]({"mousewheel.photobox": throttle(wheelNextPrev,1000) }); }}, destroy:function(){ options=this.options; this.selector .off('click.photobox', this.target) .removeData('_photobox'); close(); }} function onSwipe(e, Dx, Dy){ if(Dx==1){ image.css({transform:'translateX(25%)', transition:'.2s', opacity:0}); setTimeout(function(){ changeImage(prevImage) }, 200); } else if(Dx==-1){ image.css({transform:'translateX(-25%)', transition:'.2s', opacity:0}); setTimeout(function(){ changeImage(nextImage) }, 200); } if(Dy==1) thumbsToggler.prop('checked', true); else if(Dy==-1) thumbsToggler.prop('checked', false); } thumbsStripe=(function(){ var containerWidth=0, scrollWidth=0, posFromLeft=0, stripePos=0, animated=null, padding, el, $el, ratio, scrollPos, pos; return{ generate:function(){ var thumbsList=$('